from selenium import webdriver
from selenium.webdriver.edge.service import Service
from selenium.webdriver.edge.options import Options
import time
from src.utils.web.edge_mgr.start import edge_page,EdgePath

def edge_local_connection():
    port = 9230
    edge_page(port)
    time.sleep(2)
    options = Options()
    options.add_experimental_option("debuggerAddress", f"127.0.0.1:{port}")
    service = Service(EdgePath.get_edge_driver_path())
    driver = webdriver.Edge(service=service, options=options)
    return driver

if __name__ == '__main__':

    driver = edge_local_connection().get('https://www.guitarworld.com.cn/')
